package com.divemotor.ventarepuestosinternet.service.impl;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.divemotor.ventarepuestosinternet.beans.VehiculoBean;
import com.divemotor.ventarepuestosinternet.dao.VehiculoDAO;
import com.divemotor.ventarepuestosinternet.exception.DivemotorBusinessException;
import com.divemotor.ventarepuestosinternet.model.UsuarioCliente;
import com.divemotor.ventarepuestosinternet.model.Vehiculo;
import com.divemotor.ventarepuestosinternet.service.VehiculoService;

@Service(value="vehiculoService")
@Transactional
public class VehiculoServiceImpl implements VehiculoService,Serializable{

	private static final long serialVersionUID = 1L;
	
	@Autowired 
	private VehiculoDAO vehiculoDAO; 
	
	
	@Override
	public List<Vehiculo> listarVehiculos(UsuarioCliente usuarioCliente, VehiculoBean vehiculoBean) throws DivemotorBusinessException {
		return vehiculoDAO.listarPorCliente(usuarioCliente.getCliente(),vehiculoBean);
	}
	
	@Override
	public Vehiculo obtenerPorId(Vehiculo vehiculo) throws DivemotorBusinessException {
		return vehiculoDAO.obtenerPorId(vehiculo);
	}
}
